From e66ae56168c37ca1aaeb560c53980dc4e6985602 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 4 Dec 2009 23:52:34 +0000 Subject: [PATCH] backport miniupnpd v1.4 (#6161) SVN-Revision: 18643 --- net/miniupnpd/Makefile | 16 +++-- .../patches/001-iptcrdr_memleaks.patch | 23 +++++++ .../patches/001-makefile-tweaks.patch | 35 ---------- .../100-iptables-wan-device-name.patch | 36 ---------- .../patches/101-config.h.openwrt.patch | 38 ----------- .../patches/102-iptcrdr_memleaks.patch | 67 ------------------- 6 files changed, 33 insertions(+), 182 deletions(-) create mode 100644 net/miniupnpd/patches/001-iptcrdr_memleaks.patch delete mode 100644 net/miniupnpd/patches/001-makefile-tweaks.patch delete mode 100644 net/miniupnpd/patches/100-iptables-wan-device-name.patch delete mode 100644 net/miniupnpd/patches/101-config.h.openwrt.patch delete mode 100644 net/miniupnpd/patches/102-iptcrdr_memleaks.patch diff --git a/net/miniupnpd/Makefile b/net/miniupnpd/Makefile index b55d22b3d..1a506ac6b 100644 --- a/net/miniupnpd/Makefile +++ b/net/miniupnpd/Makefile @@ -4,14 +4,14 @@ # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # -# $Id$ include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=miniupnpd -PKG_VERSION:=1.1 -PKG_RELEASE:=5.2 -PKG_MD5SUM:=a0f6651476721db9b554668c8c83b151 +PKG_VERSION:=1.4 +PKG_RELEASE:=1 +PKG_MD5SUM:=ffa33d4ed8732c662bdb7d511e86db76 PKG_SOURCE_URL:=http://miniupnp.free.fr/files PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz @@ -23,7 +23,11 @@ define Package/miniupnpd CATEGORY:=Network DEPENDS:=+iptables TITLE:=Lightweight UPnP daemon - URL:=http://miniupnp.tuxfamily.org/ + URL:=http://miniupnp.free.fr/ +endef + +define Package/miniupnpd/conffiles +/etc/config/upnpd endef define Build/Compile @@ -39,7 +43,7 @@ define Package/miniupnpd/install $(INSTALL_DIR) $(1)/usr/bin $(1)/etc/init.d $(1)/etc/config $(1)/etc/hotplug.d/firewall $(INSTALL_BIN) $(PKG_BUILD_DIR)/miniupnpd $(1)/usr/bin/miniupnpd $(INSTALL_BIN) ./files/miniupnpd.init $(1)/etc/init.d/miniupnpd - $(INSTALL_DATA) ./files/upnpd.config $(1)/etc/config/upnpd + $(INSTALL_CONF) ./files/upnpd.config $(1)/etc/config/upnpd $(INSTALL_DATA) ./files/miniupnpd.hotplug $(1)/etc/hotplug.d/firewall/50-miniupnpd endef diff --git a/net/miniupnpd/patches/001-iptcrdr_memleaks.patch b/net/miniupnpd/patches/001-iptcrdr_memleaks.patch new file mode 100644 index 000000000..28c03a5ee --- /dev/null +++ b/net/miniupnpd/patches/001-iptcrdr_memleaks.patch @@ -0,0 +1,23 @@ +--- a/netfilter/iptcrdr.c ++++ b/netfilter/iptcrdr.c +@@ -424,10 +424,20 @@ delete_redirect_and_filter_rules(unsigne + if(h) + { + r = delete_rule_and_commit(index, h, miniupnpd_nat_chain, "delete_redirect_rule"); ++#ifdef IPTABLES_143 ++ iptc_free(h); ++#else ++ iptc_free(&h); ++#endif + } + if((r == 0) && (h = iptc_init("filter"))) + { + r = delete_rule_and_commit(index, h, miniupnpd_forward_chain, "delete_filter_rule"); ++#ifdef IPTABLES_143 ++ iptc_free(h); ++#else ++ iptc_free(&h); ++#endif + } + } + del_redirect_desc(eport, proto); diff --git a/net/miniupnpd/patches/001-makefile-tweaks.patch b/net/miniupnpd/patches/001-makefile-tweaks.patch deleted file mode 100644 index 1af76c5f2..000000000 --- a/net/miniupnpd/patches/001-makefile-tweaks.patch +++ /dev/null @@ -1,35 +0,0 @@ -Index: Makefile.openwrt -=================================================================== -RCS file: /usr/local/cvsroot/miniupnp/miniupnpd/Makefile.openwrt,v -retrieving revision 1.11 -diff -u -r1.11 miniupnpd-1.1/Makefile.openwrt ---- miniupnpd-1.1.orig/Makefile.openwrt 29 Jan 2008 12:52:03 -0000 1.11 -+++ miniupnpd-1.1/Makefile.openwrt 1 May 2008 22:34:28 -0000 -@@ -6,7 +6,7 @@ - # your openwrt SDK/etc... - # http://miniupnp.tuxfamily.org/forum/viewtopic.php?p=713 - --include $(TOPDIR)/rules.mk -+#include $(TOPDIR)/rules.mk - #CFLAGS = -Wall -O -D_GNU_SOURCE -g - #CFLAGS = -Wall -Os -D_GNU_SOURCE - #CC = mipsel-linux-gcc -@@ -16,7 +16,8 @@ - CP = cp - RM = rm -f - INSTALL = install --IPTABLESINC=$(BUILD_DIR)/iptables-1.3.3/include -+IPTABLESINC=$(STAGING_DIR)/usr/include -+#IPTABLESINC=$(BUILD_DIR)/iptables-1.3.3/include - #IPTABLESINC=$(TOPDIR)/../iptables-1.3.3/include - - BASEOBJS = miniupnpd.o upnphttp.o upnpdescgen.o upnpsoap.o \ -@@ -28,7 +29,7 @@ - NETFILTEROBJS = netfilter/iptcrdr.o - ALLOBJS = $(BASEOBJS) $(LNXOBJS) $(NETFILTEROBJS) - --LIBS = $(BUILD_DIR)/iptables-1.3.3/libiptc/libiptc.a -+#LIBS = $(BUILD_DIR)/iptables-1.3.3/libiptc/libiptc.a - #LIBS = $(TOPDIR)/../iptables-1.3.3/libiptc/libiptc.a - - TESTUPNPDESCGENOBJS = testupnpdescgen.o upnpdescgen.o diff --git a/net/miniupnpd/patches/100-iptables-wan-device-name.patch b/net/miniupnpd/patches/100-iptables-wan-device-name.patch deleted file mode 100644 index cd870708d..000000000 --- a/net/miniupnpd/patches/100-iptables-wan-device-name.patch +++ /dev/null @@ -1,36 +0,0 @@ -Index: miniupnpd-1.1/netfilter/iptables_init.sh -=================================================================== ---- miniupnpd-1.1.orig/netfilter/iptables_init.sh 2007-09-17 17:43:54.000000000 -0500 -+++ miniupnpd-1.1/netfilter/iptables_init.sh 2007-09-17 17:43:54.000000000 -0500 -@@ -1,9 +1,12 @@ - #! /bin/sh - # $Id: iptables_init.sh,v 1.3 2006/11/23 12:32:57 nanard Exp $ -+. /etc/functions.sh - IPTABLES=iptables - - #change this parameters : --EXTIF=eth0 -+include /lib/network -+scan_interfaces -+config_get EXTIF wan ifname - EXTIP="`LC_ALL=C /sbin/ifconfig $EXTIF | grep 'inet addr' | awk '{print $2}' | sed -e 's/.*://'`" - echo "External IP = $EXTIP" - -Index: miniupnpd-1.1/netfilter/iptables_removeall.sh -=================================================================== ---- miniupnpd-1.1.orig/netfilter/iptables_removeall.sh 2007-09-17 17:43:54.000000000 -0500 -+++ miniupnpd-1.1/netfilter/iptables_removeall.sh 2007-09-17 17:43:54.000000000 -0500 -@@ -1,9 +1,12 @@ - #! /bin/sh - # $Id: iptables_removeall.sh,v 1.3 2006/11/23 12:32:57 nanard Exp $ -+. /etc/functions.sh - IPTABLES=iptables - - #change this parameters : --EXTIF=eth0 -+include /lib/network -+scan_interfaces -+config_get EXTIF wan ifname - EXTIP="`LC_ALL=C /sbin/ifconfig $EXTIF | grep 'inet addr' | awk '{print $2}' | sed -e 's/.*://'`" - - #removing the MINIUPNPD chain for nat diff --git a/net/miniupnpd/patches/101-config.h.openwrt.patch b/net/miniupnpd/patches/101-config.h.openwrt.patch deleted file mode 100644 index 703821da2..000000000 --- a/net/miniupnpd/patches/101-config.h.openwrt.patch +++ /dev/null @@ -1,38 +0,0 @@ -Index: miniupnpd-1.1/config.h.openwrt -=================================================================== -RCS file: /usr/local/cvsroot/miniupnp/miniupnpd/miniupnpd-1.1/config.h.openwrt,v -retrieving revision 1.2 -diff -u -r1.2 miniupnpd-1.1/config.h.openwrt ---- miniupnpd-1.1/config.h.openwrt 26 Apr 2007 19:11:09 -0000 1.2 -+++ miniupnpd-1.1/config.h.openwrt 1 May 2008 22:47:17 -0000 -@@ -1,18 +1,27 @@ - /* $Id: miniupnpd-1.1/config.h.openwrt,v 1.2 2007/04/26 19:11:09 nanard Exp $ */ - /* MiniUPnP Project - * http:///miniupnp.free.fr -- * (c) 2006 Thomas Bernard -+ * (c) 2006-2008 Thomas Bernard - */ - #ifndef __CONFIG_H__ - #define __CONFIG_H__ - - #define UPNP_VERSION "20070228" -- -+#define USE_NETFILTER 1 - #define OS_NAME "OpenWRT" - /* OS/version */ --#define OS_VERSION "OpenWRT/WhiteRussian" -+#define OS_VERSION "OpenWRT/kamikaze" - #define OS_URL "http://openwrt.org/" - - #define LOG_MINIUPNPD LOG_DAEMON -+ -+/* Comment the following line to disable NAT-PMP operations */ -+#define ENABLE_NATPMP -+ -+/* Comment the following line to use home made daemonize() func instead -+ * of BSD daemon() */ -+#define USE_DAEMON -+ -+#define ENABLE_L3F_SERVICE - - #endif diff --git a/net/miniupnpd/patches/102-iptcrdr_memleaks.patch b/net/miniupnpd/patches/102-iptcrdr_memleaks.patch deleted file mode 100644 index 5af3c0595..000000000 --- a/net/miniupnpd/patches/102-iptcrdr_memleaks.patch +++ /dev/null @@ -1,67 +0,0 @@ -Index: miniupnpd-1.1/netfilter/iptcrdr.c -=================================================================== ---- miniupnpd-1.1.orig/netfilter/iptcrdr.c 2008-03-03 02:41:28.000000000 +0100 -+++ miniupnpd-1.1/netfilter/iptcrdr.c 2009-09-28 21:14:48.000000000 +0200 -@@ -371,11 +371,21 @@ - if(h) - { - r = delete_rule_and_commit(index, &h, "delete_redirect_rule"); -+#ifdef IPTABLES_143 -+ iptc_free(h); -+#else -+ iptc_free(&h); -+#endif - } - h = iptc_init("filter"); - if(h && (r == 0)) - { - r = delete_rule_and_commit(index, &h, "delete_filter_rule"); -+#ifdef IPTABLES_143 -+ iptc_free(h); -+#else -+ iptc_free(&h); -+#endif - } - } - del_redirect_desc(eport, proto); -@@ -465,20 +475,40 @@ - { - syslog(LOG_ERR, "%s : iptc_is_chain() error : %s\n", - logcaller, iptc_strerror(errno)); -+#ifdef IPTABLES_143 -+ iptc_free(h); -+#else -+ iptc_free(&h); -+#endif - return -1; - } - if(!iptc_append_entry(miniupnpd_chain, e, &h)) - { - syslog(LOG_ERR, "%s : iptc_append_entry() error : %s\n", - logcaller, iptc_strerror(errno)); -+#ifdef IPTABLES_143 -+ iptc_free(h); -+#else -+ iptc_free(&h); -+#endif - return -1; - } - if(!iptc_commit(&h)) - { - syslog(LOG_ERR, "%s : iptc_commit() error : %s\n", - logcaller, iptc_strerror(errno)); -+#ifdef IPTABLES_143 -+ iptc_free(h); -+#else -+ iptc_free(&h); -+#endif - return -1; - } -+#ifdef IPTABLES_143 -+ iptc_free(h); -+#else -+ iptc_free(&h); -+#endif - return 0; - } - -- 2.30.2